<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Convex - p2.js</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="icon" href="../assets/favicon.ico">
    <script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
                <h1><img src="../assets/css/logo.png" title="p2.js" width="117" height="52"></h1>
        </div>
        <div class="yui3-u-1-4 version">
            <em>API Docs for: 0.7.1</em>
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
                    <h2 class="off-left">APIs</h2>
                    <div id="api-tabview" class="tabview">
                        <ul class="tabs">
                            <li><a href="#api-classes">Classes</a></li>
                            <li><a href="#api-modules">Modules</a></li>
                        </ul>
                
                        <div id="api-tabview-filter">
                            <input type="search" id="api-filter" placeholder="Type to filter APIs">
                        </div>
                
                        <div id="api-tabview-panel">
                            <ul id="api-classes" class="apis classes">
                                <li><a href="../classes/AABB.html">AABB</a></li>
                                <li><a href="../classes/AngleLockEquation.html">AngleLockEquation</a></li>
                                <li><a href="../classes/Body.html">Body</a></li>
                                <li><a href="../classes/Box.html">Box</a></li>
                                <li><a href="../classes/Broadphase.html">Broadphase</a></li>
                                <li><a href="../classes/Capsule.html">Capsule</a></li>
                                <li><a href="../classes/Circle.html">Circle</a></li>
                                <li><a href="../classes/Constraint.html">Constraint</a></li>
                                <li><a href="../classes/ContactEquation.html">ContactEquation</a></li>
                                <li><a href="../classes/ContactMaterial.html">ContactMaterial</a></li>
                                <li><a href="../classes/Convex.html">Convex</a></li>
                                <li><a href="../classes/DistanceConstraint.html">DistanceConstraint</a></li>
                                <li><a href="../classes/Equation.html">Equation</a></li>
                                <li><a href="../classes/EventEmitter.html">EventEmitter</a></li>
                                <li><a href="../classes/FrictionEquation.html">FrictionEquation</a></li>
                                <li><a href="../classes/GearConstraint.html">GearConstraint</a></li>
                                <li><a href="../classes/GSSolver.html">GSSolver</a></li>
                                <li><a href="../classes/Heightfield.html">Heightfield</a></li>
                                <li><a href="../classes/Island.html">Island</a></li>
                                <li><a href="../classes/IslandManager.html">IslandManager</a></li>
                                <li><a href="../classes/IslandNode.html">IslandNode</a></li>
                                <li><a href="../classes/Line.html">Line</a></li>
                                <li><a href="../classes/LinearSpring.html">LinearSpring</a></li>
                                <li><a href="../classes/LockConstraint.html">LockConstraint</a></li>
                                <li><a href="../classes/Material.html">Material</a></li>
                                <li><a href="../classes/NaiveBroadphase.html">NaiveBroadphase</a></li>
                                <li><a href="../classes/Narrowphase.html">Narrowphase</a></li>
                                <li><a href="../classes/Object pooling utility..html">Object pooling utility.</a></li>
                                <li><a href="../classes/OverlapKeeper.html">OverlapKeeper</a></li>
                                <li><a href="../classes/OverlapKeeperRecord.html">OverlapKeeperRecord</a></li>
                                <li><a href="../classes/Particle.html">Particle</a></li>
                                <li><a href="../classes/Plane.html">Plane</a></li>
                                <li><a href="../classes/PrismaticConstraint.html">PrismaticConstraint</a></li>
                                <li><a href="../classes/Ray.html">Ray</a></li>
                                <li><a href="../classes/RaycastResult.html">RaycastResult</a></li>
                                <li><a href="../classes/RevoluteConstraint.html">RevoluteConstraint</a></li>
                                <li><a href="../classes/RotationalLockEquation.html">RotationalLockEquation</a></li>
                                <li><a href="../classes/.html"></a></li>
                                <li><a href="../classes/RotationalSpring.html">RotationalSpring</a></li>
                                <li><a href="../classes/RotationalVelocityEquation.html">RotationalVelocityEquation</a></li>
                                <li><a href="../classes/SAPBroadphase.html">SAPBroadphase</a></li>
                                <li><a href="../classes/Shape.html">Shape</a></li>
                                <li><a href="../classes/Solver.html">Solver</a></li>
                                <li><a href="../classes/Spring.html">Spring</a></li>
                                <li><a href="../classes/TopDownVehicle.html">TopDownVehicle</a></li>
                                <li><a href="../classes/TupleDictionary.html">TupleDictionary</a></li>
                                <li><a href="../classes/Utils.html">Utils</a></li>
                                <li><a href="../classes/vec2.html">vec2</a></li>
                                <li><a href="../classes/WheelConstraint.html">WheelConstraint</a></li>
                                <li><a href="../classes/World.html">World</a></li>
                            </ul>
                
                            <ul id="api-modules" class="apis modules">
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="yui3-u-3-4">
                <div id="api-options">
                    Show:
                    <label for="api-show-inherited">
                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited
                    </label>
            
                    <label for="api-show-protected">
                        <input type="checkbox" id="api-show-protected">
                        Protected
                    </label>
            
                    <label for="api-show-private">
                        <input type="checkbox" id="api-show-private">
                        Private
                    </label>
                    <label for="api-show-deprecated">
                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated
                    </label>
            
                </div>
            
            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
<h1>Convex Class</h1>
<div class="box meta">

        <div class="extends">
            Extends <a href="../classes/Shape.html" class="crosslink">Shape</a>
        </div>

        <div class="foundat">
            Defined in: <a href="../files/src_shapes_Convex.js.html#l8"><code>src&#x2F;shapes&#x2F;Convex.js:8</code></a>
        </div>


</div>


<div class="box intro">
    <p>Convex shape class.</p>

</div>

    <div class="constructor">
        <h2>Constructor</h2>
        <div id="method_Convex" class="method item">
            <h3 class="name"><code>Convex</code></h3>
        
                <div class="args">
                    <span class="paren">(</span><ul class="args-list inline commas">
                        <li class="arg">
                                <code class="optional">[options]</code>
                        </li>
                    </ul><span class="paren">)</span>
                </div>
        
        
        
        
        
        
        
        
            <div class="meta">
                        <p>
                        Defined in
                <a href="../files/src_shapes_Convex.js.html#l8"><code>src&#x2F;shapes&#x2F;Convex.js:8</code></a>
                </p>
        
        
        
            </div>
        
            <div class="description">
                
            </div>
        
                <div class="params">
                    <h4>Parameters:</h4>
        
                    <ul class="params-list">
                        <li class="param">
                                <code class="param-name optional">[options]</code>
                                <span class="type">Object</span>
                                <span class="flag optional" title="This parameter is optional.">optional</span>
        
        
                            <div class="param-description">
                                <p>(Note that this options object will be passed on to the <a href="../classes/Shape.html" class="crosslink">Shape</a> constructor.)</p>
        
                            </div>
        
                                <ul class="params-list">
                                    <li class="param">
                                            <code class="param-name optional">[vertices]</code>
                                            <span class="type">Array</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            <p>An array of vertices that span this shape. Vertices are given in counter-clockwise (CCW) direction.</p>
        
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[axes]</code>
                                            <span class="type">Array</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            <p>An array of unit length vectors, representing the symmetry axes in the convex.</p>
        
                                        </div>
        
                                    </li>
                                </ul>
                        </li>
                    </ul>
                </div>
        
        
        
                <div class="example">
                    <h4>Example:</h4>
        
                    <div class="example-content">
                        <pre class="code prettyprint"><code>// Create a box
        var vertices = [[-1,-1], [1,-1], [1,1], [-1,1]];
        var convexShape = new Convex({ vertices: vertices });
        body.addShape(convexShape);
        </code></pre>
                    </div>
                </div>
        </div>
    </div>

<div id="classdocs" class="tabview">
    <ul class="api-class-tabs">
        <li class="api-class-tab index"><a href="#index">Index</a></li>

            <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
            <li class="api-class-tab properties"><a href="#properties">Properties</a></li>
    </ul>

    <div>
        <div id="index" class="api-class-tabpanel index">
            <h2 class="off-left">Item Index</h2>

                <div class="index-section methods">
                    <h3>Methods</h3>

                    <ul class="index-list methods extends">
                            <li class="index-item method inherited">
                                <a href="#method_computeAABB">computeAABB</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_computeMomentOfInertia">computeMomentOfInertia</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_projectOntoAxis">projectOntoAxis</a>

                                    <span class="flag static">static</span>
                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_raycast">raycast</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_triangleArea">triangleArea</a>

                                    <span class="flag static">static</span>
                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_updateArea">updateArea</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_updateBoundingRadius">updateBoundingRadius</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_updateCenterOfMass">updateCenterOfMass</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_updateTriangles">updateTriangles</a>

                            </li>
                    </ul>
                </div>

                <div class="index-section properties">
                    <h3>Properties</h3>

                    <ul class="index-list properties extends">
                            <li class="index-item property inherited">
                                <a href="#property_angle">angle</a>

                            </li>
                            <li class="index-item property inherited">
                                <a href="#property_area">area</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_axes">axes</a>

                            </li>
                            <li class="index-item property inherited">
                                <a href="#property_body">body</a>

                            </li>
                            <li class="index-item property inherited">
                                <a href="#property_boundingRadius">boundingRadius</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_centerOfMass">centerOfMass</a>

                            </li>
                            <li class="index-item property inherited">
                                <a href="#property_collisionGroup">collisionGroup</a>

                            </li>
                            <li class="index-item property inherited">
                                <a href="#property_collisionMask">collisionMask</a>

                            </li>
                            <li class="index-item property inherited">
                                <a href="#property_collisionResponse">collisionResponse</a>

                            </li>
                            <li class="index-item property inherited">
                                <a href="#property_id">id</a>

                            </li>
                            <li class="index-item property inherited">
                                <a href="#property_material">material</a>

                            </li>
                            <li class="index-item property inherited">
                                <a href="#property_position">position</a>

                            </li>
                            <li class="index-item property inherited">
                                <a href="#property_sensor">sensor</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_triangles">triangles</a>

                            </li>
                            <li class="index-item property inherited">
                                <a href="#property_type">type</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_vertices">vertices</a>

                            </li>
                    </ul>
                </div>


        </div>

            <div id="methods" class="api-class-tabpanel">
                <h2 class="off-left">Methods</h2>

<div id="method_computeAABB" class="method item">
    <h3 class="name"><code>computeAABB</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>out</code>
                </li>
                <li class="arg">
                        <code>position</code>
                </li>
                <li class="arg">
                        <code>angle</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
            <p>Inherited from
            <a href="../classes/Shape.html#method_computeAABB">
                Shape
            </a>
            but overwritten in
        <a href="../files/src_shapes_Convex.js.html#l333"><code>src&#x2F;shapes&#x2F;Convex.js:333</code></a>
        </p>



    </div>

    <div class="description">
        
    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">out</code>
                        <span class="type"><a href="../classes/AABB.html" class="crosslink">AABB</a></span>


                    <div class="param-description">
                        
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">position</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">angle</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_computeMomentOfInertia" class="method item">
    <h3 class="name"><code>computeMomentOfInertia</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>mass</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Number</span>
        </span>







    <div class="meta">
            <p>Inherited from
            <a href="../classes/Shape.html#method_computeMomentOfInertia">
                Shape
            </a>
            but overwritten in
        <a href="../files/src_shapes_Convex.js.html#l258"><code>src&#x2F;shapes&#x2F;Convex.js:258</code></a>
        </p>



    </div>

    <div class="description">
        <p>Compute the mass moment of inertia of the Convex.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">mass</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Number</span>:
            </div>
        </div>


</div>
<div id="method_projectOntoAxis" class="method item">
    <h3 class="name"><code>projectOntoAxis</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>offset</code>
                </li>
                <li class="arg">
                        <code>localAxis</code>
                </li>
                <li class="arg">
                        <code>result</code>
                </li>
            </ul><span class="paren">)</span>
        </div>





        <span class="flag static">static</span>



    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_shapes_Convex.js.html#l124"><code>src&#x2F;shapes&#x2F;Convex.js:124</code></a>
        </p>



    </div>

    <div class="description">
        <p>Project a Convex onto a world-oriented axis</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">offset</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">localAxis</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">result</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_raycast" class="method item">
    <h3 class="name"><code>raycast</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>result</code>
                </li>
                <li class="arg">
                        <code>ray</code>
                </li>
                <li class="arg">
                        <code>position</code>
                </li>
                <li class="arg">
                        <code>angle</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
            <p>Inherited from
            <a href="../classes/Shape.html#method_raycast">
                Shape
            </a>
            but overwritten in
        <a href="../files/src_shapes_Convex.js.html#l347"><code>src&#x2F;shapes&#x2F;Convex.js:347</code></a>
        </p>



    </div>

    <div class="description">
        
    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">result</code>
                        <span class="type"><a href="../classes/RaycastResult.html" class="crosslink">RaycastResult</a></span>


                    <div class="param-description">
                        
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">ray</code>
                        <span class="type"><a href="../classes/Ray.html" class="crosslink">Ray</a></span>


                    <div class="param-description">
                        
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">position</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">angle</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_triangleArea" class="method item">
    <h3 class="name"><code>triangleArea</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>a</code>
                </li>
                <li class="arg">
                        <code>b</code>
                </li>
                <li class="arg">
                        <code>c</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Number</span>
        </span>




        <span class="flag static">static</span>



    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_shapes_Convex.js.html#l298"><code>src&#x2F;shapes&#x2F;Convex.js:298</code></a>
        </p>



    </div>

    <div class="description">
        <p>Get the area of the triangle spanned by the three points a, b, c. The area is positive if the points are given in counter-clockwise order, otherwise negative.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">a</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">b</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">c</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Number</span>:
            </div>
        </div>


</div>
<div id="method_updateArea" class="method item">
    <h3 class="name"><code>updateArea</code></h3>

        <span class="paren">()</span>








    <div class="meta">
            <p>Inherited from
            <a href="../classes/Shape.html#method_updateArea">
                Shape
            </a>
            but overwritten in
        <a href="../files/src_shapes_Convex.js.html#l311"><code>src&#x2F;shapes&#x2F;Convex.js:311</code></a>
        </p>



    </div>

    <div class="description">
        <p>Update the .area</p>

    </div>




</div>
<div id="method_updateBoundingRadius" class="method item">
    <h3 class="name"><code>updateBoundingRadius</code></h3>

        <span class="paren">()</span>








    <div class="meta">
            <p>Inherited from
            <a href="../classes/Shape.html#method_updateBoundingRadius">
                Shape
            </a>
            but overwritten in
        <a href="../files/src_shapes_Convex.js.html#l280"><code>src&#x2F;shapes&#x2F;Convex.js:280</code></a>
        </p>



    </div>

    <div class="description">
        <p>Updates the .boundingRadius property</p>

    </div>




</div>
<div id="method_updateCenterOfMass" class="method item">
    <h3 class="name"><code>updateCenterOfMass</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_shapes_Convex.js.html#l216"><code>src&#x2F;shapes&#x2F;Convex.js:216</code></a>
        </p>



    </div>

    <div class="description">
        <p>Update the .centerOfMass property.</p>

    </div>




</div>
<div id="method_updateTriangles" class="method item">
    <h3 class="name"><code>updateTriangles</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_shapes_Convex.js.html#l177"><code>src&#x2F;shapes&#x2F;Convex.js:177</code></a>
        </p>



    </div>

    <div class="description">
        <p>Update the .triangles property</p>

    </div>




</div>
            </div>

            <div id="properties" class="api-class-tabpanel">
                <h2 class="off-left">Properties</h2>

                    <div id="property_angle" class="property item inherited">
                        <h3 class="name"><code>angle</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>Inherited from
                                    <a href="../classes/Shape.html#property_angle">Shape</a>:
                            <a href="../files/src_shapes_Shape.js.html#l36"><code>src&#x2F;shapes&#x2F;Shape.js:36</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Body-local angle of the shape.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_area" class="property item inherited">
                        <h3 class="name"><code>area</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>Inherited from
                                    <a href="../classes/Shape.html#property_area">Shape</a>:
                            <a href="../files/src_shapes_Shape.js.html#l123"><code>src&#x2F;shapes&#x2F;Shape.js:123</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Area of this shape.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_axes" class="property item">
                        <h3 class="name"><code>axes</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_shapes_Convex.js.html#l47"><code>src&#x2F;shapes&#x2F;Convex.js:47</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Axes defined in the local frame.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_body" class="property item inherited">
                        <h3 class="name"><code>body</code></h3>
                        <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>Inherited from
                                    <a href="../classes/Shape.html#property_body">Shape</a>:
                            <a href="../files/src_shapes_Shape.js.html#l21"><code>src&#x2F;shapes&#x2F;Shape.js:21</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The body this shape is attached to. A shape can only be attached to a single body.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_boundingRadius" class="property item">
                        <h3 class="name"><code>boundingRadius</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                <p>Inherited from
                                <a href="../classes/Shape.html#property_boundingRadius">
                                    Shape
                                </a>
                                but overwritten in
                            <a href="../files/src_shapes_Convex.js.html#l102"><code>src&#x2F;shapes&#x2F;Convex.js:102</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The bounding radius of the convex</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_centerOfMass" class="property item">
                        <h3 class="name"><code>centerOfMass</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_shapes_Convex.js.html#l83"><code>src&#x2F;shapes&#x2F;Convex.js:83</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The center of mass of the Convex</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_collisionGroup" class="property item inherited">
                        <h3 class="name"><code>collisionGroup</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>Inherited from
                                    <a href="../classes/Shape.html#property_collisionGroup">Shape</a>:
                            <a href="../files/src_shapes_Shape.js.html#l72"><code>src&#x2F;shapes&#x2F;Shape.js:72</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Collision group that this shape belongs to (bit mask). See <a href="http://www.aurelienribon.com/blog/2011/07/box2d-tutorial-collision-filtering/">this tutorial</a>.</p>
                    
                        </div>
                    
                    
                            <div class="example">
                                <h4>Example:</h4>
                    
                                <div class="example-content">
                                    <pre class="code prettyprint"><code>// Setup bits for each available group
                    var PLAYER = Math.pow(2,0),
                        ENEMY =  Math.pow(2,1),
                        GROUND = Math.pow(2,2)
                    
                    // Put shapes into their groups
                    player1Shape.collisionGroup = PLAYER;
                    player2Shape.collisionGroup = PLAYER;
                    enemyShape  .collisionGroup = ENEMY;
                    groundShape .collisionGroup = GROUND;
                    
                    // Assign groups that each shape collide with.
                    // Note that the players can collide with ground and enemies, but not with other players.
                    player1Shape.collisionMask = ENEMY | GROUND;
                    player2Shape.collisionMask = ENEMY | GROUND;
                    enemyShape  .collisionMask = PLAYER | GROUND;
                    groundShape .collisionMask = PLAYER | ENEMY;
                    </code></pre><pre class="code prettyprint"><code>// How collision check is done
                    if(shapeA.collisionGroup &amp; shapeB.collisionMask)!=0 &amp;&amp; (shapeB.collisionGroup &amp; shapeA.collisionMask)!=0){
                        // The shapes will collide
                    }
                    </code></pre>
                                </div>
                            </div>
                    
                    </div>
                    <div id="property_collisionMask" class="property item inherited">
                        <h3 class="name"><code>collisionMask</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>Inherited from
                                    <a href="../classes/Shape.html#property_collisionMask">Shape</a>:
                            <a href="../files/src_shapes_Shape.js.html#l109"><code>src&#x2F;shapes&#x2F;Shape.js:109</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Collision mask of this shape. See .collisionGroup.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_collisionResponse" class="property item inherited">
                        <h3 class="name"><code>collisionResponse</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>Inherited from
                                    <a href="../classes/Shape.html#property_collisionResponse">Shape</a>:
                            <a href="../files/src_shapes_Shape.js.html#l103"><code>src&#x2F;shapes&#x2F;Shape.js:103</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Whether to produce contact forces when in contact with other bodies. Note that contacts will be generated, but they will be disabled. That means that this shape will move through other body shapes, but it will still trigger contact events, etc.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_id" class="property item inherited">
                        <h3 class="name"><code>id</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>Inherited from
                                    <a href="../classes/Shape.html#property_id">Shape</a>:
                            <a href="../files/src_shapes_Shape.js.html#l58"><code>src&#x2F;shapes&#x2F;Shape.js:58</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Shape object identifier.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_material" class="property item inherited">
                        <h3 class="name"><code>material</code></h3>
                        <span class="type"><a href="../classes/Material.html" class="crosslink">Material</a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>Inherited from
                                    <a href="../classes/Shape.html#property_material">Shape</a>:
                            <a href="../files/src_shapes_Shape.js.html#l116"><code>src&#x2F;shapes&#x2F;Shape.js:116</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Material to use in collisions for this Shape. If this is set to null, the world will use default material properties instead.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_position" class="property item inherited">
                        <h3 class="name"><code>position</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>Inherited from
                                    <a href="../classes/Shape.html#property_position">Shape</a>:
                            <a href="../files/src_shapes_Shape.js.html#l27"><code>src&#x2F;shapes&#x2F;Shape.js:27</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Body-local position of the shape.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_sensor" class="property item inherited">
                        <h3 class="name"><code>sensor</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>Inherited from
                                    <a href="../classes/Shape.html#property_sensor">Shape</a>:
                            <a href="../files/src_shapes_Shape.js.html#l130"><code>src&#x2F;shapes&#x2F;Shape.js:130</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Set to true if you want this shape to be a sensor. A sensor does not generate contacts, but it still reports contact events. This is good if you want to know if a shape is overlapping another shape, without them generating contacts.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_triangles" class="property item">
                        <h3 class="name"><code>triangles</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_shapes_Convex.js.html#l90"><code>src&#x2F;shapes&#x2F;Convex.js:90</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Triangulated version of this convex. The structure is Array of 3-Arrays, and each subarray contains 3 integers, referencing the vertices.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_type" class="property item inherited">
                        <h3 class="name"><code>type</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>Inherited from
                                    <a href="../classes/Shape.html#property_type">Shape</a>:
                            <a href="../files/src_shapes_Shape.js.html#l42"><code>src&#x2F;shapes&#x2F;Shape.js:42</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The type of the shape. One of:</p>
                    <ul>
                    <li><a href="../classes/Shape.html#property_CIRCLE" class="crosslink">Shape.CIRCLE</a></li>
                    <li><a href="../classes/Shape.html#property_PARTICLE" class="crosslink">Shape.PARTICLE</a></li>
                    <li><a href="../classes/Shape.html#property_PLANE" class="crosslink">Shape.PLANE</a></li>
                    <li><a href="../classes/Shape.html#property_CONVEX" class="crosslink">Shape.CONVEX</a></li>
                    <li><a href="../classes/Shape.html#property_LINE" class="crosslink">Shape.LINE</a></li>
                    <li><a href="../classes/Shape.html#property_BOX" class="crosslink">Shape.BOX</a></li>
                    <li><a href="../classes/Shape.html#property_CAPSULE" class="crosslink">Shape.CAPSULE</a></li>
                    <li><a href="../classes/Shape.html#property_HEIGHTFIELD" class="crosslink">Shape.HEIGHTFIELD</a></li>
                    </ul>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_vertices" class="property item">
                        <h3 class="name"><code>vertices</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_shapes_Convex.js.html#l32"><code>src&#x2F;shapes&#x2F;Convex.js:32</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Vertices defined in the local frame.</p>
                    
                        </div>
                    
                    
                    
                    </div>
            </div>


    </div>
</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
